package com.springinaction.springidol;

import java.util.Collection;

/**
 * 一个人演奏多种乐器
 * 
 * @author tidecc
 */
public class OneManBand implements Performer{

	/*
	 * 声明乐器队列， 使用Spring注入;
	 */
	private Collection<Instrument> instruments;
	public void setInstruments(Collection<Instrument> instruments){
		this.instruments = instruments;
	}

	@Override
	public void perform() throws PerformanceException {
		for (Instrument instrument : instruments) {
			instrument.play();
		}
	}
}
